<template>
  <div id="app">
    <el-button @click="showQueryFilter = true">Show</el-button>
    <el-query-filter
      :isShow.sync="showQueryFilter"
      :options="queryFilterOptions"
      @confirm="confirmHandler"
    ></el-query-filter>
    <span>{{data}}</span>
  </div>
</template>

<script>
export default {
  name: "app",
  data() {
    return {
      data: "",
      showQueryFilter: true,
      // 查询条件
      queryFilterOptions: {
        fields: [
          { label: "姓名", value: "name" },
          { label: "年龄", value: "age" },
          { label: "手机号", value: "phone" },
        ],
        operators: [
          { label: "=", value: "eq" },
          { label: ">", value: "gt" },
          { label: "≥", value: "ge" },
          { label: "<", value: "lt" },
          { label: "≤", value: "le" },
        ],
        logics: [
          { label: "且", value: "and" },
          { label: "或", value: "or" },
        ],
      },
    };
  },
  methods: {
    confirmHandler(data) {
      this.data = data
    }
  }
};
</script>

<style></style>
